<template>
  <div style="display: inline">
    <div
      style="display: inherit"
      :title="fixedText"
      v-if="isfixedHeader"
      @click="fix(false)"
    >
      <svg
        t="1668593907681"
        class="icon"
        viewBox="0 0 1024 1024"
        version="1.1"
        xmlns="http://www.w3.org/2000/svg"
        p-id="2704"
        width="18"
        height="18"
      >
        <path
          d="M547.1 889.4L134.3 476.6c-15.8-15.8-3.9-42.9 18.5-41.8l118.6 5.6 311.9-207.9 5.5-92.8c1.2-21.1 26.8-30.8 41.8-15.9l269.3 269.3c14.9 14.9 5.2 40.5-15.9 41.8l-92.8 5.5-207.9 311.9 5.6 118.6c1.1 22.4-25.9 34.3-41.8 18.5z"
          fill="#EF5343"
          p-id="2705"
        ></path>
        <path
          d="M354.6 470.9c-4 0-7.8-1.9-10.2-5.5-3.8-5.6-2.2-13.2 3.4-17l190-126.7c5.6-3.8 13.2-2.2 17 3.4 3.8 5.6 2.2 13.2-3.4 17l-190 126.7c-2.1 1.4-4.5 2.1-6.8 2.1z"
          fill="#FFFFFF"
          p-id="2706"
        ></path>
        <path
          d="M899.9 393.2l-61.3-61.3c14.9 14.9 5.2 40.5-15.9 41.8l-92.8 5.5L522 691l5.6 118.6c1.1 22.4-26 34.3-41.8 18.5l61.3 61.3c15.8 15.8 42.9 3.9 41.8-18.5l-5.6-118.6 207.9-311.9L884 435c21.1-1.3 30.8-26.9 15.9-41.8z"
          fill="#D84141"
          p-id="2707"
        ></path>
        <path
          d="M587.3 307.7m-12.3 0a12.3 12.3 0 1 0 24.6 0 12.3 12.3 0 1 0-24.6 0Z"
          fill="#FFFFFF"
          p-id="2708"
        ></path>
        <path
          d="M912.9 380.2L643.5 110.9c-12.1-12.1-29.6-15.8-45.6-9.8s-26.6 20.5-27.6 37.6l-4.9 83.7-299.1 199.4-112.6-5.4c-17.8-0.7-34 9.2-41.3 25.5s-3.7 35 8.9 47.7L314.7 683 102.5 895.2c-7.2 7.2-7.2 18.8 0 26 3.6 3.6 8.3 5.4 13 5.4s9.4-1.8 13-5.4L340.7 709l193.4 193.4c8.3 8.3 19.1 12.6 30.2 12.6 5.9 0 11.8-1.2 17.4-3.7 16.3-7.2 26.3-23.4 25.5-41.3l-5.4-112.6 199.5-299.2 83.7-4.9c17.1-1 31.5-11.6 37.6-27.6s2.4-33.4-9.7-45.5z m-24.6 32.5c-0.5 1.4-1.9 3.7-5.4 3.9l-85.2 5-135.3-135.3c-7.2-7.2-18.8-7.2-26 0-7.2 7.2-7.2 18.8 0 26l130.9 130.9-187.5 281.2-223.7-223.7c-7.2-7.2-18.8-7.2-26 0-7.2 7.2-7.2 18.8 0 26l225.1 225.1c2.8 2.8 6.3 4.5 9.9 5.1l5.5 114.9c0.2 3.5-1.9 5.1-3.6 5.9-1.7 0.8-4.4 1.2-6.8-1.3L147.3 463.6c-2.5-2.5-2-5.1-1.3-6.8 0.8-1.7 2.5-4 5.9-3.6l118.6 5.6c3.9 0.2 7.8-0.9 11.1-3.1l311.9-207.9c4.8-3.2 7.8-8.5 8.2-14.2l5.5-92.8c0.2-3.5 2.6-4.8 3.9-5.4 1.4-0.5 4.1-1 6.5 1.4l269.3 269.3c2.4 2.5 1.9 5.2 1.4 6.6z"
          fill="#2D3742"
          p-id="2709"
        ></path>
      </svg>
    </div>
    <div
      style="display: inherit"
      :title="unFixedText"
      v-else
      @click="fix(true)"
    >
      <svg
        t="1668594485297"
        class="icon"
        viewBox="0 0 1024 1024"
        version="1.1"
        xmlns="http://www.w3.org/2000/svg"
        p-id="3516"
        width="20"
        height="20"
      >
        <path
          d="M474.6 246.7H592V452H474.6zM722.3 596.9C720 536.5 642.5 488 547.2 488s-172.8 48.5-175.1 108.9h350.2zM665.8 192.5H389.2c-9.9 0-18-8.1-18-18s8.1-18 18-18h276.6c9.9 0 18 8.1 18 18s-8.1 18-18 18z"
          fill="#25B195"
          p-id="3517"
        ></path>
        <path
          d="M658.2 206.5H359.9c-25.8 0-46.9-21-46.9-46.9s21-46.9 46.9-46.9h298.4c25.8 0 46.9 21 46.9 46.9s-21.1 46.9-47 46.9z m-298.3-63.6c-9.2 0-16.7 7.5-16.7 16.7s7.5 16.7 16.7 16.7h298.4c9.2 0 16.7-7.5 16.7-16.7s-7.5-16.7-16.7-16.7H359.9zM512.3 909l-46.6-303.6h86.7z"
          fill="#4E4D4D"
          p-id="3518"
        ></path>
        <path
          d="M667.8 484.8c-17.2-13.1-36.6-23.9-57.6-32H407.9c-21 8.2-40.4 18.9-57.6 32-21.3 16.3-38.2 35.4-50.1 56.9-12.7 23-19.2 47.6-19.2 73.1v17.9h456.1v-17.9c0-25.5-6.5-50.1-19.2-73.1-11.9-21.5-28.7-40.6-50.1-56.9zM312.7 596.9c5.3-30.6 24-59.2 53.9-82.1C404.5 485.9 455 470 509.1 470c54 0 104.6 15.9 142.4 44.8 30 22.9 48.7 51.6 53.9 82.1H312.7z"
          fill="#4E4D4D"
          p-id="3519"
        ></path>
        <path
          d="M607 468H409V181h198v287z m-161.6-35.5h125.1v-216H445.4v216z"
          fill="#4E4D4D"
          p-id="3520"
        ></path>
      </svg>
    </div>
  </div>
</template>

<script>
export default {
  name: 'FixedTableHead',
  props: {
    fixedHeader: {
      default: false
    },
    fixedText: {
      default: '取消固定表头'
    },
    unFixedText: {
      default: '固定表头'
    }
  },
  computed: {
    isfixedHeader() {
      return this.fixedHeader
    }
  },
  methods: {
    fix(bool) {
      this.$emit('update:fixedHeader', bool)
    }
  }
}
</script>

<style></style>
